<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"    uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
    
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">成本管理-司机工资单价管理</li>
    </ol>
    
    <div class="ms-content-layout has-operation">
    
      <div class="ms-operation-bar no-margin no-bottom-border clearfix">
        <div class="ms-operation-group pull-right">
        
          <c:if test="${empty currentPrincipal.transOrgId}">
            <a href="${ctx.host}/driver-salaries/search"  class="btn ms-btn ms-btn-blue" data-toggle="modal" data-target="#search">
              <i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;过滤查询
            </a>
          </c:if>
          
          <a href="${ctx.host}/driver-salaries/create" class="btn ms-btn ms-btn-blue"  data-toggle="modal" data-target="#create">设置司机工资单价</a>
        </div>
      </div>

      <table class="table table-hover ms-table">
        <thead>
            <tr>
              <th>运输公司</th>
              <th>驾驶员人数</th>
              <th>主驾重载工资</th>
              <th>第一副驾重载工资</th>
              <th>主驾空载工资</th>
              <th>第一副驾空载工资</th>
            </tr>
        </thead>
        <tbody>
        
          <c:forEach items="${truckDriverSalaries}" var="truckDriverSalary">
          
            <tr>
              <td>${truckDriverSalary.organization.name}</td>
              <td>${truckDriverSalary.driverCount}</td>
              <td><fmt:formatNumber value="${truckDriverSalary.mainDriverFullSalary}" maxFractionDigits="2" pattern="0.00"/></td>
              <td><fmt:formatNumber value="${truckDriverSalary.firstViceDriverFullSalary}" maxFractionDigits="2" pattern="0.00"/></td>
              <td><fmt:formatNumber value="${truckDriverSalary.mainDriverEmptySalary}" maxFractionDigits="2" pattern="0.00"/></td>
              <td><fmt:formatNumber value="${truckDriverSalary.firstViceDriverEmptySalary}" maxFractionDigits="2" pattern="0.00"/></td>
            </tr>
              
          </c:forEach>
          
        </tbody>
        <tfoot>
          <tr>
            <td colspan="6" class="no-vertical-padding">
              <div class="pull-left">
                  <jsp:include page="/WEB-INF/include/page.jsp">
                <jsp:param name="url" value="${ctx.host}/driver-salaries" />
                <jsp:param name="queryString" value="${queryString}" />
                  </jsp:include>
              </div>
              
      			  <div class="pull-right">
                <c:if test="${page.totals > 0}">
        					<a href="${ctx.host}/driver-salaries/export?${queryString}&per_page=${config.everyPage}&page=${page.currentPage}" class="btn btn-default">输出当前记录</a>
        					<a href="${ctx.host}/driver-salaries/export?${queryString}&per_page=${config.limit}" class="btn btn-default">输出所有记录</a>
                </c:if>
      			  </div>
            </td>
          </tr>
        </tfoot>
      </table>

    </div> 
  </div>       
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/data/cost/driver-salary-list.js" />
  <script type="text/javascript">
      require(['page/data/cost/driver-salary-list'], function(page) {
        page.init()
      })
  </script>
  
</body>
</html>